{% extends "base/content.html" %}
{% load crispy_forms_tags %}
{% block title %}
  {% blocktrans with instance_name=form.instance.name %}
    Delete Ingredient {{ instance_name }}
  {% endblocktrans %}
{% endblock %}
{% block content %}
  <h5 class="">
    {% blocktrans with instance_name=form.instance.name%}
        Delete Ingredient {{ instance_name }} .
      {% endblocktrans %}
  </h5>
  <p>
    <dl>
      {% for field in form %}
        <dt>{{ field.label }}</dt>
        <dd>
          {{ field.value }}
        </dd>
      {% endfor %}
    </dl>
  </p>
  <p class="text-danger">
    {% blocktrans %}
    Are you sure you want to delete this ingredient? This operation is irreversible.
    {% endblocktrans%}
  </p>
  <div class="py-3 fixed-bottom text-end bg-dark">
    <form method="post"
          action="{% url 'canteen:delete_ingredient' form.instance.pk %}"
          style="display: inline">
      {% csrf_token %}
      <button type="submit" class="btn btn-danger">{% trans 'Delete' %}</button>
      <button type="button" class="btn btn-primary" onclick="window.close();">
        {% trans "Cancel" %}
      </button>
    </form>
  </div>
  <script>
    localize_content($("dd"))
  </script>
{% endblock %}
